The present invention relates to a disk control apparatus for recording and reproducing compressed data to/from a physical device such as a direct accessing apparatus or the like and, more particularly, to a disk control apparatus for recording and reproducing even compression data whose data size changes as fixed length block data to/from a physical device.
An external memory subsystem of a computer system needs a capacity which can store data such as many text files, program files, image data files, and the like in order to cope with multi-media. As an external memory subsystem, a magnetic disk subsystem using a magnetic disk drive having characteristics such as non-volatility of the recording, large capacity, high speed of data transfer, and the like is widely used. As a method of improving the capacity and reducing the costs of the magnetic disk subsystem, attention is paid to a data compression in recent years.
According to a conventional data compression, a capacity of a disk drive is increased by compressing data using software residing on a host computer. The data compression by the software results in increase in disk capacity while sacrificing CPU performance. The data compression by the software is limited to fields as in the data back-up, data conveyance, and the like in which a high access response speed of data is not required. In case of executing the data compression on the host computer side, a data amount to be stored in the disk drive is recognized by the host computer, so that a necessary memory capacity and a remaining memory capacity can be managed by the host computer in a manner similar to the case where there is no compressing process.
However, when the data compression is executed by the CPU of a disk control unit in order to reduce a load of the host computer, the data amount to be stored in the disk drive is not known until the compressing process is finished, so that the remaining memory capacity cannot be managed by the host computer and there is a problem such that it takes a time to assure a main memory, or the like.
In an ordinary host computer, data is recorded and reproduced to/from a fixed length sector of the disk drive similarly on a fixed length data block unit basis (logic block unit basis). Since compression data obtained from the fixed length logic block becomes variable length data of various sizes due to the character of the data. Therefore, in a method of recording the variable length compression data into the fixed length sector of the present disk drive, the compression data cannot be effectively stored on a disk medium, so that an effective activity ratio of the disk medium is remarkably low. That is, when the variable length compression data is recorded as a recording unit into the fixed length sector on the disk medium, a vain portion in which no data is recorded exists and the effective activity ratio of the disk often deteriorates.
Further, in the case where the compression data is read out from the disk medium by a read request from the host computer and expanded and, after that, updated, when the updated data is compressed, since the data size changes from that of the data before updating, the data cannot be always stored at the original location on the disk medium. Therefore, a number of fragmentations (vacancies) occur on the disk medium. In order to eliminate the fragmentation, a segment cleaning has to be executed from time to time. During the execution of the segment cleaning, inputting/outputting processes for the disk drive have to be stopped and the device is busy during such a period of time, so that there is a problem of a deterioration of an accessing performance.
Further, when a compression ratio is high, a difference between a logic address which is managed by the host computer and a physical address to manage the compression data on the disk medium is large. Consequently, there is a problem such that the value of the logic address which was decided in consideration of a seek performance of the disk drive is lost and an accessing performance deteriorates.